									
/*------------------------------------------------------------------------------------------------------------------------
This replicate the numbers for the tabels and figures in the ARTICLE "Mammography screening: eliciting the voices of 
informed citizens" by Manja D. Jensen, Kasper M. Hansen, Volkert Siersma and John Brodersen.
--------------------------------------------------------------------------------------------------------------------------*/


/*Note: The analyses into relative importance was done in R and uses a set of procedures we have developed - and which are 
still under development - to solve a broad range of problems dealing with relative importance. As these procedures will be 
the basis for a future paper in statistical methods development, we cannot publish these procedures at this moment. 
The data for the analyses into relative importance in the present paper is made available though, and the description of 
the analyses in the paper and the references would be enough for a statistician to reproduce these analyses. */


/*The four dataset used:*/

libname manja "INSERT FILE PATH";run;
data SURVEYRECODE; set manja.SURVEYRECODE;run;
data longdata; set manja.longdata;run;	
data longdataT2ref; set manja.longdataT2ref;run;
data longdataT3ref; set manja.longdataT3ref;run;


/*-------------------------------------VARIABLES in the dataset "SURVEYRECODE"------------------------------------------*/

/*
Aldersgruppe (Age group) 1=18-30, 2=31-40, 3=41-50, 4=51-60, 5=61-70.
Brystkraeft (History of breast cancer in the family)(1=yes, 2=no, 3=don't know, 4= don't want to answer)
Civilstand (Merital status), 1=Never merried and not living with a partner.2=Merried or civil partnerchip, 3=living with partner (no papers), 4=Seperated/Divorced, 5=Widowed
Koen (Sex)1=male, 2=female
Region (Recidence) 1=Capital region, 2=Region Zealand, 3=Region of Southern DK, 4=Central Dk, 5= Northern DK.
AUsundhed  (Working/educated within the healthcare sector), 1=yes 2=no.
Gennemfoertudd (Education)1=7-13 years, 2=Vocational training, 3=Short, 4=middle, 5=long.
T1HVBekymret (Worry) 1=never, 2=less than once a month, 3=once a month, 4=once a week, 5=daily, 6=several times daily, 7=don't know.
T1K1 (Conceptual nowledge, diagnosis), 1= correct answer.
T1K2 (Conceptual knowledge, overdiagnosis), 1=correct answer.
T1V4dikot (Recommendation at T1: Continuation of mammography screening), 1=strongly agree, 2= all other answers.
T1V4kontinuert (Recommendation at T1: Continuation of mammography screening), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T3V4kontinuert (Recommendation at T3: Continuation of mammography screening),  100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
AendringV4T1T3 (= sum(T3V4kontinuert - T1V4kontinuert)
MindrepositivT1T3 (Less positive recommendation) 1= less posivive (AendringV4T1T3 = -25 or -50 or -75 or -100), 0= not less positive.
AendringvidenT1T3 (Change in knowledge points = knowledge points at T3 minus knowledge points at T1)

The following items describe the change in different knowledge items from T1 to T3. They are coded in the same way: 1= incorrect answer at T1 but correct answer at T3, 0= no change, -1: correct answer at T1 but incorrect at T3.
AendringkorrektK1T1T3 (Change in correct answers (between T1 and T3) conceptual knowledge question: Screening increases breast cancer diagnoses (K1)
AendringkorrektK2T1T3 (Change in correct answers (between T1 and T3) conceptual knowledge question: Screening leads to some women getting unnecessary treatment (K2)
AendringkorrektK3T1T3 (Change in correct answers (between T1 and T3) conceptual knowledge question: Not all breast cancers cause illness (K3)
AendringkorrektK4T1T3 (Change in correct answers (between T1 and T3) conceptual knowledge question: Screening will not find every breast cancer (k4)
AendringkorrektK5T1T3 (Change in correct answers (between T1 and T3) conceptual knowledge question: Screening reduces breast cancer deaths (K5)
AendringkorrektK6T1T3 (Change in correct answers (between T1 and T3) conceptual knowledge question: The meaning of false positive results (K6)
AendringkorrektK7T1T3 (Change in correct answers (between T1 and T3) conceptual knowledge question: Screening may result in prolonged life as a patient (K7)
AendringkorrektK8T1T3 (Change in correct answers (between T1 and T3) conceptual knowledge question: Screening is for women without symptoms (K8)
AendringkorrektK9T1T3 (Change in correct answers (between T1 and T3) conceptual knowledge question: Benefit evaluation � reduced mortality (K9)
AendringkorrektN1gistT1T3 (Change in correct answers (between T1 and T3) numerical knowledge questions: Breast cancer mortality without mammography screening (Gist1)
AendringkorrektN2gistT1T3 (Change in correct answers (between T1 and T3) numerical knowledge questions: Breast cancer mortality with mammography screening (Gist2)
AendringkorrektN3gistT1T3 (Change in correct answers (between T1 and T3) numerical knowledge questions: Overdiagnosis (Gist3)
AendringkorrektN4gistT1T3 (Change in correct answers (between T1 and T3) numerical knowledge questions: False positives (Gist4)

T1VaegtKontinuert (Opinion item "Balance", T1), 75=most in agreement with A, 25=most in agreement with B, 50=Don't know, 50=Neither agreeing with A nor B.
T3VaegtKontinuert (Opinion item "Balance", T3), 75=most in agreement with A, 25=most in agreement with B, 50=Don't know, 50=Neither agreeing with A nor B.
T1Bekymret2Kontinuert (Opinion item "Worry", T1), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T3Bekymret2Kontinuert (Opinion item "Worry", T3), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T1PolitKontinuert (Opinion item "Politics", T1), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T3PolitKontinuert (Opinion item "Politics", T3), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T1SSTKontinuert (Opinion item "Authorities", T1), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T3SSTKontinuert (Opinion item "Authorities", T3), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T1TilhaengerKontinuert (Opinion item "Support", T1) 100= Strong support, 75=support, 50=neither, 25= opponent 0=strong opponent, 50=don't know.
T3TilhaengerKontinuert (Opinion item "Support", T3) 100= Strong support, 75=support, 50=neither, 25= opponent 0=strong opponent, 50=don't know.
T1Key1Kontinuert (Opinion item "Effect", T1), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T3Key1Kontinuert (Opinion item "Effect", T3), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T1Key2Kontinuert (Opinion item "Costs", T1), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T3Key2Kontinuert (Opinion item "Costs", T3), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T1Key3Kontinuert (Opinion item "Qualified", T1), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T3Key3Kontinuert (Opinion item "Qualified", T3), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T1Key4Kontinuert (Opinion item "Mandatory1", T1), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T3Key4Kontinuert (Opinion item "Mandatory1", T3), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T1Key5Kontinuert (Opinion item "Mandatory2", T1), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T3Key5Kontinuert (Opinion item "Mandatory2", T3), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T1Key6Kontinuert (Opinion item "Ethics", T1), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T3Key6Kontinuert (Opinion item "Ethics", T3), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T1Key7Kontinuert (Opinion item "Acquaintances", T1), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T1Key7Kontinuert (Opinion item "Acquaintances", T3), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T1Key9Kontinuert (Opinion item "regret", T1), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T3Key9Kontinuert (Opinion item "regret", T3), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T1Key10Kontinuert (Opinion item "Seen", T1), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.
T1Key10Kontinuert (Opinion item "Seen", T1), 100=strongly agree, 75=somewhat agree, 50=Neither agree nor disagree, 25=somewhat disagree, 0=Strongly disagree, 50=Don't know.

The following items describe the change in different opinion items from T1 to T3:
AendringVaegtT1T3 (Change in the opinion item, "Balance" between T1 and T3 =sum(T3VaegtKontinuert - T1VaegtKontinuert)
AendringBekymret2T1T3 (Change in the opinion item, "Worry" between T1 and T3) =sum(T3Bekymret2Kontinuert- T1Bekymret2Kontinuert)
AendringPolitT1T3 (Change in the opinion item, "Politics" between T1 and T3) =sum(T3PolitKontinuert-T1PolitKontinuert)
AendringSSTT1T3 (Change in the opinion item, "Authorities" between T1 and T3) =sum(T3SSTKontinuert-T1SSTKontinuert)
AendringTilhaengerT1T3 (Change in the opinion item, "Support" between T1 and T3) =sum(T3TilhaengerKontinuert-T1TilhaengerKontinuert)
Aendringkey1T1T3 (Change in the opinion item, "Effect" between T1 and T3) =sum(T3Key1Kontinuert- T1Key1Kontinuert)
Aendringkey2T1T3 (Change in the opinion item, "Costs" between T1 and T3) =sum(T3Key2Kontinuert- T1Key2Kontinuert)
Aendringkey3T1T3 (Change in the opinion item, "Qualified" between T1 and T3) =sum(T3Key3Kontinuert- T1Key3Kontinuert);
Aendringkey4T1T3 (Change in the opinion item, "Mandatory1" between T1 and T3) =sum(T3Key4Kontinuert- T1Key4Kontinuert);
Aendringkey5T1T3 (Change in the opinion item, "Mandatory2" between T1 and T3) =sum(T3Key5Kontinuert- T1Key5Kontinuert);
Aendringkey6T1T3 (Change in the opinion item, "Ethics" between T1 and T3) =sum(T3Key6Kontinuert- T1Key6Kontinuert);
Aendringkey7T1T3 (Change in the opinion item, "Acquaintances" between T1 and T3) =sum(T3Key7Kontinuert- T1Key7Kontinuert);
Aendringkey9T1T3 (Change in the opinion item, "Regret" between T1 and T3) =sum(T3Key9Kontinuert- T1Key9Kontinuert);
Aendringkey10T1T3 (Change in the opinion item, "Seen" between T1 and T3) =sum(T3Key10Kontinuert- T1Key10Kontinuert);

Overens (Reccommendation in accordance with preferences regarding mortality reduction and overdiagnosis,T3)1= Recommendation in accordance with preferences, 99=Recomendation not in accordance with preferences. 
OverensRekrut (Reccommendation in accordance with preferences regarding mortality reduction and overdiagnosis,T1)1= Recommendation in accordance with preferences, 99=Recomendation not in accordance with preferences.
Preferences (at T3 about mortality reduction and overdiagnosis), 1= preferences matching a recommendation to continue, 2= matching not to continue, 99= not matching
PreferenceRekrut (at T3 about mortality reduction and overdiagnosis), 1= preferences matching a recommendation to continue, 2= matching not to continue, 99= not matching
Brystkraeftdikot (History of breast cancer in the family) 1= yes.
T1Vidensniveaumedtogrxx (Knowledge at recruitment), 1 >50% correct, 2<50% correct.
Alderscut50 (Age dicotomised), 1= age <50, 2= age >=50.
T1V4 (Recommendation at T1: Continuation of mammography screening), 1=strongly agree, 2=somewhat agree, 3=Neither agree nor disagree, 4=somewhat disagree, 5=Strongly disagree, 6=Don't know.
T2V4 (Recommendation at T2: Continuation of mammography screening), 1=strongly agree, 2=somewhat agree, 3=Neither agree nor disagree, 4=somewhat disagree, 5=Strongly disagree, 6=Don't know. 
T3V4 (Recommendation at T3: Continuation of mammography screening), 1=strongly agree, 2=somewhat agree, 3=Neither agree nor disagree, 4=somewhat disagree, 5=Strongly disagree, 6=Don't know.
T4V4 (Recommendation at T4: Continuation of mammography screening), 1=strongly agree, 2=somewhat agree, 3=Neither agree nor disagree, 4=somewhat disagree, 5=Strongly disagree, 6=Don't know.
T1SP9 (T1, Preference, mortality reduction), 1=1, 2=2, 3=5, 4=20, 5=50, 6=don't know.
T1SP10(T1, Preference, overdiagnosis), 1=0, 2=1, 3=5, 4=20, 5=100, 6=150, 7=500, 8=don't know.
T3SP9 (T3, Preference, mortality reduction), 1=1, 2=2, 3=5, 4=20, 5=50, 6=don't know.
T3SP10(T3, Preference, overdiagnosis), 1=0, 2=1, 3=5, 4=20, 5=100, 6=150, 7=500, 8=don't know.
ODtogrNY3 (Acceptance of overdiagnosis) 1= high levels (100,150 and 500), 2=low levels (1,2,5 and 20).
T3V4togrNY (Recommendation at T3: Continuation of mammography screening) 1= strongly agree, 2= all other answers.
T3ODvidentotal (Knowledge about overdiagnosis): 3= 3 out of 3 correct answers, 1= 0,1 or 2 correct out of 3.
 */
 


 
/*-------------------------------------VARIABLES in the dataset "longdata"------------------------------------------
T (Timepoint) 99=recruitment, 2=after video information, 3= after deliberation, 4= one month after the assembly.
ID (number)
V4dikot (Reccommendation,Continuation of mammography screening), 1=strongly agree, 2= all other answers.
V4 (Reccommendation,Continuation of mammography screening), 1=strongly agree, 2=somewhat agree, 3=Neither agree nor disagree, 4=somewhat disagree, 5=Strongly disagree, 6=Don't know.
*/
   

/*-------------------------------------VARIABLES in the dataset "longdataT2ref"------------------------------------------
T (Timepoint) 1=recruitment, 99=after video information, 3= after deliberation, 4= one month after the assembly
ID (number)
V4dikot (Reccommendation,Continuation of mammography screening) 1=strongly agree, 2= all other answers.
*/


/*-------------------------------------VARIABLES in the dataset "longdataT3ref"------------------------------------------
T (Timepoint) 1=recruitment, 2=after video information, 99= after deliberation, 4= one month after the assembly
ID (number)
V4dikot (Reccommendation,Continuation of mammography screening) 1=strongly agree, 2= all other answers.
*/
 





/*---------------------------------------------TABLE 1----------------------------------------------*/

/*right column*/
proc freq data=SURVEYRECODE;
tables T1V4dikot; /*nopercent norow*/;
run;
proc freq data=SURVEYRECODE;
tables T1V4dikot * (T1K1 T1K2 Aldersgruppe Brystkraeft Civilstand Koen region AUsundhed Gennemfoertudd T1HVBekymret)/; /*nopercent norow*/;
run;

/*left colums*/
Proc freq data=surveyrecode;
tables T1K1 T1K2 Aldersgruppe Brystkraeft Civilstand Koen region AUsundhed Gennemfoertudd T1HVBekymret; /*nopercent norow*/;
run;

/*CHI squared TEST Tabel 1, 
(General population data was found at Statistics Denmark, year 2020, population 18-70years)*/

data tabelkoen;
input data$ koen$ antal;
datalines;
Sampel kvinde 43
Sampel mand 46
General kvinde  1932018
General mand 1953779
;
run;
proc freq data=tabelkoen;
tables data*koen
/ nopercent nocol chisq expected riskdiffc;
weight antal;
run;

Data Tabelalder;
Input data $ alder$ antal;
datalines;
Sample 1830 18
Sample 3140 17
Sample 4150 21
Sample 5160 18
Sample 6170 15
Generel 1830 993248
Generel 3140 681810
Generel 4150 758737
Generel 5160 796573
Generel 6170 655429
;
run;
Proc freq data=Tabelalder;
Table data*alder/chisq;
Weight antal;
Run;

Data Tabeludd;
Input data $ udd$ antal;
datalines;
Sample 713 36
Sample vocational 25
Sample short 7
Sample mid 12
Sample long 9
Generel 713 1431049
Generel vocational 1156204
Generel short 207283
Generel mid 721888
Generel long 470368
;
run;
Proc freq data=Tabeludd;
Table data*udd/chisq;
Weight antal;
Run;

Data TabelCivilstatus;
Input data$ Civilstatus$ antal;
Datalines;
Sample Never 45
Sample Married 28
Sample Divorced 12
Sample Widowed 4
General Never 1661572
General Married 1711806
General Divorced 448196
General Widowed 64223
;
Run;
Proc freq data=TabelCivilstatus;
Table data*civilstatus/chisq;
Weight antal;
Run;

data tabelworry;
input data$ worry$ antal;
datalines;
Sampel Never 27
Sampel Less 47
Sampel OnceM 7
Sampel OnceW 2
Sampel Daily 1
Sampel Several 2
Sampel Dontknow 3
General Never 426
General Less 586
General OnceM 110
General OnceW 29
General Daily 15
General Several 7
General Dontknow 101
;
run;
Proc freq data=Tabelworry;
Table data*worry/chisq;
Weight antal;
Run;

data tabelHealthcare;
input data$ Health$ antal;
datalines;
Sampel ja 13
Sampel nej 76
General ja 193
General nej 1093
;
run;
proc freq data=tabelHealthcare;
tables data*Health
/ nopercent nocol chisq expected riskdiffc;
weight antal;
run;

data tabelHistory;
input data$ History$ antal;
datalines;
Sampel ja 33
Sampel no 52
Sampel dontknow 4
General ja 410
General no 638
General dontknow 64
;
run;
proc freq data=tabelHistory;
tables data*History
/ nopercent nocol chisq expected riskdiffc;
weight antal;
run;

Data tabelKnowD;
input data$ KnowD$ antal;
datalines;
Sampel ja 61
Sampel nej 28
General ja 791
General nej 477
;
run;
proc freq data=tabelKnowD;
tables data*KnowD
/ nopercent nocol chisq expected riskdiffc;
weight antal;
run;

Data tabelKnowO;
input data$ KnowO$ antal;
datalines;
Sampel ja 14
Sampel nej 75
General ja 175
General nej 1093
;
run;
proc freq data=tabelKnowO;
tables data*KnowO
/ nopercent nocol chisq expected riskdiffc;
weight antal;
run;








/*---------------------------------------------TABLE 2------------------------------------------------------------*/

/*FIRST PART of table 1: Correlations between recommendation and knowledge*/

/*vidensindex*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringvidenT1T3;
run;

/*Hvert vidensitem for sig*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringkorrektK1T1T3;
run;

proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringkorrektK2T1T3;
run;

proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringkorrektK3T1T3;
run;

proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringkorrektK4T1T3;
run;

proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringkorrektK5T1T3;
run;

proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringkorrektK6T1T3;
run;

proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringkorrektK7T1T3;
run;

proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringkorrektK8T1T3;
run;

proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringkorrektK9T1T3;
run;

proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringkorrektN1gistT1T3;
run;

proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringkorrektN2gistT1T3;
run;

proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringkorrektN3gistT1T3;
run;

proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringkorrektN4gistT1T3;
run;

/*SECOND PART of table 1: Correlations between recommendation and opinion items*/

/*v�gtning*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringVaegtT1T3;
run;

/*bekymring*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringBekymret2T1T3;
run;

/*polit*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringPolitT1T3;
run;

/*autorities*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringSSTT1T3;
run;

/*tilh�nger*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 AendringTilhaengerT1T3;
run;

/*effekt*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 Aendringkey1T1T3;
run;

/*costs*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 Aendringkey2T1T3;
run;

/*qualified*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 Aendringkey3T1T3;
run;

/*mandatory1*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 Aendringkey4T1T3;
run;

/*mandatory2*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 Aendringkey5T1T3;
run;

/*ethics*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 Aendringkey6T1T3;
run;

/*Acquaintances*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 Aendringkey7T1T3;
run;

/*Regret*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 Aendringkey9T1T3;
run;

/*seen*/
proc corr data=surveyrecode fisher;
var aendringV4T1T3 Aendringkey10T1T3;
run;




/*----------------------------------------TABLE 3------------------------------------------------------------------------*/

/*Overensstemmelse mellem anbefaling + acceptabel effekt + acceptabel OD 
(Dvs. dem der siger forts�t+accepterer lille effekt (1,2 el 5/1009) og accepterer meget OD 20 og op)
ELLER dem der siger stop + accepterer st�rre effekt eller kun lidt OD.*/

proc freq data= surveyrecode;
tables T1V4;
run;
proc freq data= surveyrecode;
tables T3V4;
run;

proc freq data= surveyrecode;
tables overens;
run;

proc freq data= surveyrecode;
tables overensRekrut;
run;

proc freq data= surveyrecode;
tables preference;
run;

proc freq data= surveyrecode;
tables preferenceRekrut;
run;

proc freq data= surveyrecode;
tables preference *T3V4;
run;

proc freq data= surveyrecode;
tables preferenceRekrut *T1V4;
run;



/*-----------------------------------------------TABLE in Appendix------------------------------------------------------*/

/*Breast cancer in family*/
proc freq data= surveyrecode;
tables   Brystkraeftdikot* mindrepositivT1T3; 
run;

proc freq data= surveyrecode;
tables  Brystkraeftdikot* mindrepositivT1T3/
chisq nopercent expected riskdiffc relrisk;
run;

proc genmod data= surveyrecode; /*logistisk reg*/
class mindrepositivT1T3 Brystkraeftdikot;
model mindrepositivT1T3 (event="1") = Brystkraeftdikot/dist=bin link=logit type3;
estimate  "Brystkraeftdikot=1" Brystkraeftdikot 1 -1/exp; 
run;

/*Knowledge at recruitment - Viden ved T1 og �ndring i anbefaling. 
Viden gr 2= under 50% rigtige ved T1 vidensgr=1 har mere end 50% rigtige*/
proc freq data= surveyrecode;
tables  T1Vidensniveaumedtogrxx*mindrepositivT1T3;
run;

proc freq data= surveyrecode;
tables  T1Vidensniveaumedtogrxx*mindrepositivT1T3/
chisq nopercent expected riskdiffc relrisk;
run;

proc genmod data= surveyrecode; /*logistisk reg*/
class mindrepositivT1T3 T1Vidensniveaumedtogrxx;
model mindrepositivT1T3 (event="1") = T1Vidensniveaumedtogrxx/dist=bin link=logit type3;
estimate  "T1Vidensniveaumedtogr=1" T1Vidensniveaumedtogrxx 1 -1/exp; 
run;


/*K�n og �ndring i anbefaling*/
proc freq data= surveyrecode;
tables koen* mindrepositivT1T3;
run;

proc freq data= surveyrecode;
tables koen* mindrepositivT1T3/
chisq nopercent expected riskdiffc relrisk;
run;


/*Arb/udd indenfor sundhedsv�senet og �ndring i anbefaling*/
proc freq data= surveyrecode;
tables  AUsundhed* mindrepositivT1T3;
run;

proc freq data= surveyrecode;
tables  AUsundhed* mindrepositivT1T3/
chisq nopercent expected riskdiffc relrisk;
run;

proc genmod data= surveyrecode; /*logistisk reg*/
class mindrepositivT1T3 AUsundhed;
model mindrepositivT1T3 (event="1") = AUsundhed/dist=bin link=logit type3;
estimate  "AUsundhed=1" AUsundhed 1 -1/exp; 
run;


/*Alder (over under 50�r som er screeningsstart) og �ndring i anbefaling*/
proc freq data= surveyrecode;
tables  Alderscut50 *mindrepositivT1T3;
run;

proc freq data= surveyrecode;
tables  Alderscut50 *mindrepositivT1T3/
chisq nopercent expected riskdiffc relrisk;;
run;







/*----------------------------------------------FIGURE 1--------------------------------------------------------------*/

/*Recommendation*/
proc freq data=SURVEYRECODE;
tables T1V4 T2V4 T3V4 T4V4;
run;

proc freq data=longdata;
tables  V4 *T / nopercent norow; 
run;

/*Arrows*/
proc freq data=surveyrecode;
tables T1V4*T2V4;
run;

proc freq data=surveyrecode;
tables T2V4*T3V4;
run;

proc freq data=surveyrecode;
tables T3V4*T4V4;
run;



/*Beregning af p-v�rdier i Barchart - p-v�rdier for forskellen mellem Strongly agree 
for tiderne T1-T2, T1-T3 og T1-T4 (T1 er ref). Afl�s under hhv. 2,3 og 4 i output*/
Proc genmod data=longdata descending;
   Class T ID;
   Model V4dikot=T/dist=bin link=id type3;
   Repeated subject=ID/type=ind corrw;
Run;

/*Beregning af p-v�rdier i Barchart - p-v�rdier for forskellen mellem Strongly agree 
for tiderne T2-T3 (T2 er ref) Afl�s under 3 i output*/
Proc genmod data=longdataT2ref descending;
   Class T ID;
   Model V4dikot=T/dist=bin link=id type3;
   Repeated subject=ID/type=ind corrw;
Run;

/*Beregning af p-v�rdier i Barchart - p-v�rdier for forskellen mellem Strongly agree 
for tiderne T3-T4 (T3 er ref) Afl�s under 4 i output*/
Proc genmod data=longdataT3ref descending;
   Class T ID;
   Model V4dikot=T/dist=bin link=id type3;
   Repeated subject=ID/type=ind corrw;
Run;





/*--------------------------------------------FIGURE 3 and 4----------------------------------------------------*/

/* "ET GODT PROGRAM": hvor stor effekt og hvor mange OD pr. 1000 kvinder er godt nok? hhv. til tiden T1 og T3
SP9:Hvor mange skal undg� at d� ud af 1000 kvinder der screenes, for at du synes programmet er godt? (fiksed svarkategorier 1,2,5,20,50, ved ikke)
(kodning: 1=1, 2=2, 3=5, 4=20, 5=50, 6=ved ikke)
SP10:Hvor mange kan du acceptere bliver overdiagnostiseret n�r 1/1000 undg�r at d� af brystkr�ft? (fiksed kategorier 0,1,5,20,100,150,500,ved ikke)
(kodning: 1=0, 2=1, 3=5, 4=20, 5=100, 6=150, 7=500, 8=ved ikke)*/

Proc freq data= surveyrecode;
tables T1SP9;
run;

Proc freq data= surveyrecode;
tables T1SP10;
run;

Proc freq data= surveyrecode;
tables T3SP9;
run;

Proc freq data= surveyrecode;
tables T3SP10;
run;



/*-------------------------------------------FIGURE 5-------------------------------------------------------------*/

/*Anbefaling: n=85, Ja=strongly agree, nej =resten af svarene (dvs somewhat agree, strongly og strongly disagree +dont know og hverken eller)
Accept af OD: lidt (0,2,5,20) vs meget (100,150,500), ved ikke er smidt ud - dvs n=65.
Viden: lav (enten 0,1 eller 2 af i alt 3 rigtige) vs h�j (3 af 3 rigtige).*/

Proc freq data= surveyrecode;
tables ODtogrNY3*T3V4togrNY/chisq nopercent expected riskdiffc relrisk;
run;

Proc freq data= surveyrecode;
tables T3ODvidentotal*ODtogrNY3/chisq nopercent expected riskdiffc relrisk;
run;

Proc freq data= surveyrecode;
tables T3ODvidentotal*T3V4togrNY/chisq nopercent expected riskdiffc relrisk;
run;



/*------------------------------------------------------------------------------------------------------------------*/

















